package com.xinghen.security.core.validate.code;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * @author xinghen
 * @ClassName: ValidateCodeRepository
 * @Package: com.xinghen.security.core.validate.code
 * @Description 验证码存取器
 * @create 2018-04-18 14:38
 */
public interface ValidateCodeRepository {

    /**
     * 保存验证码
     *
     * @param request
     * @param code
     * @param codeType
     */
    void save(ServletWebRequest request, ValidateCode code, ValidateCodeType codeType);

    /**
     * 获取验证码
     *
     * @param request
     * @param codeType
     * @return
     */
    ValidateCode get(ServletWebRequest request, ValidateCodeType codeType);

    /**
     * 移除验证码
     *
     * @param request
     * @param codeType
     */
    void remove(ServletWebRequest request, ValidateCodeType codeType);

}
